<?php
$user = $_POST['user'];
$conn = new mysqli("localhost","root","","simple_weibo");
$conn->query("set names 'utf8'");
$sql = "select * from weibo_user where user_name='$user'";
$res = $conn->query($sql);
if($user==""||$res->num_rows>0){
    echo "用户已经存在!";
//    $data = array("status"=>1,"msg"=>"用户名已经存在!");
}else{
    echo "用户可以使用!";  
//     $data = array("status"=>0,"msg"=>"用户名可以使用!");
}

// echo json_encode($data);
